#ifndef _PACKING_GRAPHICS_H_
#define	_PACKING_GRAPHICS_H_

#include <algorithm>

#include <Geex/graphics/opengl.h>
#include <glut_viewer/glut_viewer.h>
#include <GL/glut.h>
#include "packer.h"


namespace Field_packing
{
	using namespace Packing_common;

	class Packing_graphics
	{
		typedef Packing_polygon::Point_2	Point_2;

	public:
		Packing_graphics(Packer* _Packer) ;
		~Packing_graphics();
		void print_screen();
		void draw() ;
		void redraw();
		GLboolean& toggle_polygons() { return show_polygons; }
		GLboolean& toggle_circles() { return show_circles; }
		GLboolean& toggle_distance_field() { return show_distance_field; }
		GLboolean& toggle_inter_result() { return store_inter_result; }
		GLboolean& toggle_delaunay() { return show_delaunay; }
		GLboolean& toggle_holes() { return show_holes; }
		GLboolean& toggle_CAT() { return show_CAT; }
		GLboolean& toggle_vacant_space() { return show_vacancy; }
		//GLboolean& toggle_triangulation() { return show_triangulation ; }
		//GLboolean& toggle_voronoi() { return show_voronoi; }
		//GLboolean& toggle_cat() { return show_cat; }
		GLboolean& toggle_bd_box() { return show_bd_box; }
		//GLboolean& toggle_large_room() { return show_large_room; }
		int& set_highlight_no() { return highlight_no; }
		int& set_vacant_group_no() { return vacant_group_no; }

	private:
		void draw_polygons() ;
		void sync_draw_polygons();

	private:
		Packer* packer ;
		GLboolean show_polygons;
		GLboolean show_circles; // draw bounding circles
		GLboolean show_bd_box;
		GLboolean show_distance_field;
		GLboolean store_inter_result;
		GLboolean show_delaunay;
		GLboolean show_holes;
		GLboolean show_CAT;
		GLboolean show_vacancy;
		// debug
		GLboolean show_sampling_pnts;
		std::vector<Packing_polygon> sync_polygons;

		int highlight_no;
		int vacant_group_no;
	};

}

#endif